<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/tags/trymore" prefix="tm"%>

<style>
	.tbl td {border-color: #797979}
	#tblprof td.banner {line-height: 30px; font-size: 18px; font-weight: bold; text-align: center; margin: 0;}
	#tblprof td.field {background-color: #CFDBEC; line-height: 25px; text-align: center; margin: 0; width: 100px; font-size: 9pt;}
	#tblprof input.textInput {float:none;margin: 5px; width: 80px; height: 23px;}
	#toleader {display: none; position: relative; top: 2px;}
</style>

<script type="text/javascript">
$(function(){
	var panel = $.pdialog.getCurrent() && $.pdialog.getCurrent().filter(":visible").length > 0 ? $.pdialog.getCurrent() : navTab.getCurrentPanel();
	$("#audit_post_confer", panel).unbind("click");
	$("#audit_post_confer", panel).click(function(){
		if ($("input[type=radio]", panel).filter(":checked").size() == 0) {
			alertMsg.error("请选择审批状态...");
			return;
		}
		
		$("#formAuditConfer").submit();
	});
	
	$.each($("input[name='auditState']", panel), function(){
		$(this).unbind("click");
		$(this).click(function(){
			var state = $(this).val();
			if (state == "1") {
				$("#toleader", panel).css("display", "inline");
				$("#toleader", panel).removeAttr("disabled");
			} else {
				$("#toleader", panel).css("display", "none");
				$("#toleader", panel).attr("disabled", "disabled");
			}
		});
	});
	
});
</script>

<form method="post" action="${op ne null && op eq 'audit' ? 'app/conference.do?action=actionAuditConference' : 'app/conference.do?action=actionSaveConference'}" 
	class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);" id="formAuditConfer">
	<div class="pageContent">
		<div class="pageFormContent" layoutH="56">
			<%@ include file="../form/formConference.jsp" %>
		</div>
		
		<div class="formBar">
			<ul>
				<c:choose>
					<c:when test="${op ne null && op eq 'audit'}">
						<li>
							<label style="float:left; position: relative; top: 5px;">审核意见：</label>
							<input type="text"  name="auditComments" class="textInput" value="" style="width: 300px"/>
							<input type="radio" name="auditState" value="1" class="state_normal" />通过 
							<input type="radio" name="auditState" value="-1" class="state_normal" />退回 
							<input type="radio" name="auditState" value="2" class="state_normal"/>否决
						</li>
						<c:if test="${entity.leaderAudit eq null || (entity.leaderAudit ne null && entity.leaderAudit ne 1)}">
							<li id="toleader">
								<input type="checkbox" name="leaderAudit" value="1" style="vertical-align:middle"/> 提交到院领导
							</li>
						</c:if>
						<li style="margin-left: 20px">
							<div class="button"><div class="buttonContent"><button type="button" id="audit_post_confer">提交审批</button></div></div>
						</li>
					</c:when>
					<c:otherwise>
						<c:choose>
							<c:when test="${entity.status eq -1}">
								<li>
									<div class="button"><div class="buttonContent"><button type="submit">重新提交审批</button></div></div>
								</li>
							</c:when>
							<c:otherwise>
								<li>
									<div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
								</li>
							</c:otherwise>
						</c:choose>
					</c:otherwise>
				</c:choose>
			</ul>
		</div>
	</div>
</form>
